﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.SqlClient;
using System.Text;

namespace DigDes.DS2012.DataAccess
{
    public class LoaderCommands : DataAccessBase
    {
        private SqlCommand _command;

        public LoaderCommands(string storedProcedureName, SqlParameter[] sqlParameter)
        {
            _command = CreateSPCommand(storedProcedureName, sqlParameter, false);
        }

        public LoaderCommands(string storedProcedureName)
        {
            _command = CreateSPCommand(storedProcedureName, false);
        }

        public void ExecCommand()
        {
            using (_command.Connection)
            {
                _command.Connection.Open();
                _command.ExecuteNonQuery();
            }
        }
    }
}
